var api = require('../../utils/api.js');
var app = getApp();
Page({
    data: {
        tophe:0,
        mobiles:[]
    },
    currentPageNumber: 1,
        onLoad() {
        var file=api.FIlE;
        this.setData({
            bg:file
        })
       
    },
    onShow() {
        let jn = wx.getMenuButtonBoundingClientRect();
        var that=this;
        console.log(jn);
        var tophe=jn.top+jn.height+80;
        this.setData({
            tophe:tophe+'px',
            over:jn.top
        })

        api.post({
            url: 'user/index',
            data: {},
            success: data => {
                that.setData({
                    user:data.data,
                    avatar:data.data.avatar
                });
            },
        });
        api.post({
            url: 'index/getmobile',
            data: {},
            success: data => {
                that.setData({
                    mobiles:data.data
                });
            },
        });
     
    },

    //个人信息
    setEmail(){
        wx.navigateTo({
          url: '/pages/user/setEmail',
        })
    },

    //会议通知
    setMobile(){
        wx.navigateTo({
          url: '/pages/user/setMobile',
        })
    },
 
    //住宿
    favorite(){
        wx.navigateTo({
            url: '/pages/house/index',
            })
    },

    //就餐信息
    comment(){
        wx.navigateTo({
            url: '/pages/comment/comment',
            })
    },
    calllmobile(){
        var mobiles=this.data.mobiles;

        wx.showActionSheet({
            itemList:mobiles,
       
            success (res) {
              console.log(res.tapIndex)
              var index=res.tapIndex;
              var mobile=mobiles[index];

              wx.makePhoneCall({
                phoneNumber: mobile
              })

            },
           
          })
          

    }



});
